# -*- coding: utf-8 -*-

import bullet

class BasicWeapon:
    def __init__(self):
        self.delay = 0
    def attack(self, point, player):
        pass
    def aim(self, angle):
        pass
    def update(self, t):
        """t is time between shots"""
        pass

class Chainsaw(BasicWeapon):
    def __init__(self):
        self.delay = 0
    def attack(self, point, player):
        """Commence an attack emmanating fron point"""
        #play sound chainsaw
        player.killer = True
        #animera attacken

class Gun(BasicWeapon):
    def __init__(self):
        self.delay = 0
        self.ammo = 5
    def attack(self, point, player):
        if not self.delay > 0:
            self.delay = 10
            self.ammo -= 1
            if player.direction == "left":
                vel = (-20, 0)
            else:
                vel = (20, 0)
            return bullet.Bullet(point, vel, "bullet.png")
    def aim(self, angle):
        #unimplemented
        pass
    def update(self, t):
        """t is time between shots"""
        delay -= 1

